#include <bits/stdc++.h>
// 2024/08/06
// tag: 模拟
using namespace std;

int n, m, k;
int CompetitionDate[1001][1001];
bool Prepare[1001][1001];

signed main()
{
    // 输入n, m, k
    cin >> n >> m >> k;
    // 输入CompetitionDate数组
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= m; ++j)
            cin >> CompetitionDate[i][j];

    // 将CompetitionDate数组中的值作为Prepare数组的索引，将Prepare数组对应位置的值设为true
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= m; ++j)
            Prepare[CompetitionDate[i][j]][j] = true;
    
    // 遍历Prepare数组，统计Prepare数组中每个元素为true的个数
    for (int i = 1; i <= k; ++i){
        int cnt = 0;
        for (int j = 1; j <= m; ++j)
            cnt += Prepare[i][j];
        // 输出每个元素为true的个数
        cout << cnt << " ";
    }

    return 0;
}